<?php
$form = $this->beginWidget('CActiveForm', array(
    'action' => Yii::app()->createUrl($this->route),
    'method' => 'get',
));
?>
<div>
<table cellspacing="0" cellpadding="0" border="0">
	<tbody>
		<tr>
			<td><?php
			echo $form->textField($model, 'keyword', array('autocomplete' => 'off',
			    'placeholder' => t('MSG_PROFILE_SEARCH_TEXTBOX', 'messages'),
			    'class' => 'keyword'
			    ));
			    ?></td>
			<td><?php echo $form->dropDownList($model, 'sex', CHtml::listData(LGHelpers::getSexListData(), 'id', 'name'), array('empty' => t('MSG_FIRST_ITEM_SEX', 'messages'))); ?>
			</td>
			<td><?php echo $form->dropDownList($model, 'status', CHtml::listData(LGHelpers::getStatusListData(), 'id', 'name'), array('empty' => t('MSG_FIRST_ITEM_STATUS', 'messages'))); ?>
			</td>
			<td><?php
			echo $form->dropDownList($model, 'birth_place', Province::model()->getChtmlLanguage(), array('style' => 'width:150px', 'empty' => t('MSG_FIRST_ITEM_BIRTH_PLACE', 'messages')));
			?></td>
			<td><?php
			echo $form->dropDownList(AdvanceProfile::model(), 'hiring_company_id', HiringCompany::model()->getChtmlDropdownDataByName(), array('style' => 'width:150px', 'empty' => t('DROPDOWN_FIRST_ITEM_HIRING_COMPANY', 'advanceProfile')));
			?></td>
			<td><?php
			echo $form->dropDownList(AdvanceProfile::model(), 'introducing_company_id', IntroducingCompany::model()->getChtmlDropdownData(), array('style' => 'width:150px', 'empty' => t('DROPDOWN_FIRST_ITEM_INTRODUCING_COMPANY', 'advanceProfile')));
			?></td>
			<td><?php
			echo $form->dropDownList(HiringCompany::model(), 'union_id', Union::model()->getChtmlDropdownData(), array('style' => 'width:150px', 'empty' => t('DROPDOWN_FIRST_ITEM_UNION', 'hiringCompany')));
			?></td>
			<td><?php echo Html::buttonFilter(); ?></td>
			<td><input id="btnAdvanceFilter" name="btnAdvanceFilter"
				class="button filter" type="button" value="Tìm nâng cao"></td>
		</tr>
	</tbody>
</table>
</div>
<div class="advance-search" id="advance-search" style="display: none">
<table class="form">
	<tbody>
		<tr>
			<td class="label"><?php echo t('LBL_BIRTH_YEAR', 'profile') ?></td>
			<td class="input"><?php
			echo $form->textField($model, 'birth_year', array('style' => 'width:60px'));
			?></td>
		</tr>
		<tr>
			<td class="label"><?php echo $form->label($model, 'age'); ?></td>
			<td>
			<?php echo $form->textField($model, 'age', array('style' => 'width:60px'));?>
			</td>
		</tr>
		<tr>
			<td class="label"><?php echo $form->label($model, 'height'); ?></td>
			<td>
			<?php echo $form->textField($model, 'height', array('style' => 'width:60px'));?>
			<?php echo $form->label($model, 'weight');?>
			<?php echo $form->textField($model, 'weight', array('style' => 'width:60px'));?>
			</td>
		</tr>
		<tr>
			<td><?php
			echo t('LBL_EYE_CAPABILITY','profile');
			?></td>
			<td><?php echo $form->label($model, 'left_eye'); ?> <?php echo $form->dropDownList($model, 'left_eye', CHtml::listData(LGHelpers::getEyeCapabilityListData(),'id','name'), array('empty' => t('MSG_FIRST_ITEM_COMMON', 'messages'))); ?>
			<?php echo $form->label($model, 'right_eye'); ?> <?php echo $form->dropDownList($model, 'right_eye', CHtml::listData(LGHelpers::getEyeCapabilityListData(),'id','name'), array('empty' => t('MSG_FIRST_ITEM_COMMON', 'messages'))); ?>
			</td>
		</tr>
		<tr>
			<td class="label"><?php echo $form->label($model, 'blood_group'); ?></td>
			<td><?php            
			echo $form->textField($model, 'blood_group', array('style' => 'width:60px'));
			?></td>
		</tr>
		<tr>
			<td class="label"><?php echo $form->label($model, 'do_drink_alcohol'); ?></td>
			<td><?php echo $form->dropDownList($model, 'do_drink_alcohol', CHtml::listData(LGHelpers::getYesNoData(),'id','name'), array('empty' => t('MSG_FIRST_ITEM_COMMON', 'messages'))); ?>
			</td>
		</tr>
		<tr>
			<td class="label"><?php echo $form->label($model, 'do_smoke'); ?></td>
			<td><?php echo $form->dropDownList($model, 'do_smoke', CHtml::listData(LGHelpers::getYesNoData(),'id','name'), array('empty' => t('MSG_FIRST_ITEM_COMMON', 'messages'))); ?>
			</td>
		</tr>
		<tr>
			<td class="label"><?php echo $form->label(Family::model(), 'married'); ?></td>
			<td><?php echo $form->dropDownList(Family::model(), 'married', CHtml::listData(LGHelpers::getYesNoData(),'id','name'), array('empty' => t('MSG_FIRST_ITEM_COMMON', 'messages'))); ?>
			</td>
		</tr>
		<tr>
			<td class="label">Ngày bay:</td>
			<td>
			<?php echo $form->label($model, 'month_of_flight'); ?>
			<?php echo $form->dropDownList($model, 'month_of_flight', CHtml::listData(LGHelpers::getMonthListData(),'id','name'), array('empty' => t('MSG_FIRST_ITEM_COMMON', 'messages'))); ?>
			<?php echo $form->label($model, 'year_of_flight'); ?>
			<?php echo $form->dropDownList($model, 'year_of_flight', CHtml::listData(LGHelpers::getYearListData(1990, 2030),'id','name'), array('empty' => t('MSG_FIRST_ITEM_COMMON', 'messages'))); ?>
			</td>
		</tr>
		<tr>
			<td class="label"><?php echo $form->label($model, 'order'); ?></td>
			<td><?php
				echo $form->textField($model, 'order', array('style' => 'width:134px'));
				?></td>
		</tr>
	</tbody>
</table>
<div class="close" id="close-advance-search">X</div>
</div>
			<?php $this->endWidget(); ?>
<script type="text/javascript">
	$(document).ready(function() {
		$('#btnFilter').click(function() {
			$('#advance-search').slideUp('slow', function() {
				$('#btnAdvanceFilter').show();
			});
		});
		$('#btnAdvanceFilter').click(function() {
			$('#btnAdvanceFilter').hide();
			$('#advance-search').slideToggle("slow");
		});
		$('#close-advance-search').click(function() {
			$('#advance-search').slideUp('slow', function() {
				$('#btnAdvanceFilter').show();
			});
		});
	});
        LGCMS.addTooltip();
	$(function() {
	    $(".datepicker").datepicker({
	        'dateFormat': 'dd-mm-yy',
	        changeMonth: true,
	        changeYear: true,
	        'buttonImage': '<?php echo themeUrl(); ?>/images/datepicker.gif',
            'showOn': 'both',
            'buttonImageOnly': 'true',
            'buttonText': "Chọn ngày",
            'showAnim': 'slideDown',
            'yearRange': '-60:+0'
	    });
	});
</script>



